package com.bjesc_b2c.app.appraiset.widget.view;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Rect;
import android.util.AttributeSet;
import android.view.View;

import com.bjesc_b2c.app.appraiset.camera.DisplayUtil;


/**
 * 自定义拍照框View
 *
 * Created by up_girl on 2017/3/30.
 */
public class TakePhotoView extends View {

    private Context mContext;
    private Paint mPaint;

    public TakePhotoView(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.mContext = context;
        mPaint = new Paint();
        mPaint.setAntiAlias(false);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        // 拍照框预览的宽高设置
        Rect frame = new Rect(0, 0, DisplayUtil.getScreenWidth(mContext), DisplayUtil.getScreenHeight(mContext) );

        mPaint.setColor(Color.GRAY);
        Rect faceRect = new Rect();
        faceRect.left = frame.left;
        faceRect.right = frame.right;
        faceRect.top = frame.top;
        faceRect.bottom = frame.bottom;
//        canvas.drawBitmap(((BitmapDrawable) (getResources().getDrawable(R.drawable.face_take_photo_bg))).getBitmap(), null, faceRect, mPaint);
    }
}
